/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package commands.gui;

import dataTypes.File;
import dataTypes.Host;
import java.util.List;
import java.util.ListIterator;

/**
 * A command returning search results
 * @author Marcin Kamionowski
 */
public class GUISearchResult extends GUICommand {

    private final int idSearch;
    private final Host host;
    private List<File> files;

    /**
     * Constructor
     * @param idSearch Id of search
     * @param files List of founded files
     * @param host Owner of that files
     */
    public GUISearchResult(int idSearch, List<File> files, Host host) {
        super(GUICommandType.SEARCH_RESULT);
        this.idSearch = idSearch;
        this.files = files;
        this.host = host;
    }

    /**
     * Getter
     * @return Id of search
     */
    public int getIdSearch() {
        return idSearch;
    }

    /**
     * Getter
     * @return List of founded files
     */
    public ListIterator<File> getIterator() {
        return files.listIterator();
    }

    /**
     * Getter
     * @return Owner of that files
     */
    public Host getHost() {
        return host;
    }
}
